<?php
/**
 * Created by PhpStorm.
 * User: linlin
 * Date: 2017/3/9
 * Time: 14:35
 */
namespace app\Modules\Api\filters;

use Yii;
use yii\base\ActionFilter;

class JsonFilter extends ActionFilter
{
    public function beforeAction($action)
    {
        $response = Yii::$app->response;
        $response->format = \yii\web\Response::FORMAT_JSON;
        return parent::beforeAction($action);
    }
}